package com.ustb.util;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.*;

/**
 * Created by admin on 2017/11/18.
 */
public class SystemInfo {
    private static final Properties pro;
    private static Map<String,String> properties;
    private static int streamCount=-1;

    static {
        pro = new Properties();
        properties=new HashMap<>();
        try{
            InputStream in = SystemInfo.class.getClassLoader().getResourceAsStream("/config.properties");
            pro.load(in);
            Iterator<String> it=pro.stringPropertyNames().iterator();
            while(it.hasNext()){
                String key=it.next();
                properties.put(key,pro.getProperty(key));
            }
            in.close();
        }catch (Exception e){
            e.printStackTrace();
        }
    }



        /**
         * 读取系统配置文件信息
         * @return
         */
    public static Map<String, String> getProperties() {
        return properties;
    }

}
